{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
    <div class="content">
        <!-- nav start -->
        {{include file="pluginsadmin/nav" /}}
        <!-- nav end -->

        <!-- operation start -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
            <div class="am-g am-margin-bottom-sm am-margin-top-sm">
                <a href="{{:MyUrl('admin/pluginsadmin/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
            </div>
        {{/if}}
        <!-- operation end -->

        {{if !empty($data_list)}}
            <ul data-am-widget="gallery" class="am-gallery am-avg-sm-1 am-avg-md-2 am-avg-lg-3 am-gallery-bordered" data-am-gallery="{}">
                {{foreach $data_list as $v}}
                    <li>
                        <div id="data-list-{{$v.plugins}}" class="am-gallery-item {{if $v['is_enable'] neq 1}}am-active{{/if}}">
                            <img src="{{$v.logo}}" class="icon" />
                            <div class="base">
                                <h3 class="name">{{$v.name}}</h3>
                                <p>作者：{{$v.author}}</p>
                                <p>主页：<a href="{{$v.author_url}}" target="_blank">{{$v.author_url}}</a></p>
                                <p>版本：{{$v.version}}</p>
                            </div>
                            <div class="am-gallery-desc">{{$v.desc}}</div>
                            <div class="operation">
                                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                    <a href="{{:MyUrl('admin/pluginsadmin/saveinfo', array('id'=>$v['plugins']))}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" title="编辑"></a>
                                    <a href="{{:MyUrl('admin/pluginsadmin/download', array('id'=>$v['plugins']))}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-download" title="打包"></a>
                                {{/if}}

                                {{if isset($v['is_install']) and $v['is_install'] eq 1}}
                                    <a href="{{:PluginsAdminUrl($v['plugins'], 'admin', 'index')}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-gear" title="设置"></a>
                                    
                                    <button class="am-btn am-btn-default am-btn-xs am-radius am-icon-circle-o submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/uninstall')}}" data-id="{{$v.plugins}}" data-view="reload" data-msg="卸载将删除基础数据不可恢复、确认操作吗？" title="卸载"></button>

                                    <a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('admin/pluginsadmin/statusupdate')}}" data-id="{{$v.plugins}}" data-state="{{$v['is_enable']}}" data-is-update-status="1" title="状态"></a>
                                {{else /}}
                                    <button class="am-btn am-btn-default am-btn-xs am-radius am-icon-remove submit-delete-modal" data-url="{{:MyUrl('admin/pluginsadmin/delete')}}" data-id="{{$v.plugins}}" title="删除"></button>

                                    <button class="am-btn am-btn-default am-btn-xs am-radius am-icon-cubes submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/install')}}" data-id="{{$v.plugins}}" data-view="reload" data-msg="进行安装操作、确认继续吗？" title="安装"></button>
                                {{/if}}

                                {{if isset($v['is_home']) and $v['is_home'] eq true}}
                                    <a href="{{:PluginsHomeUrl($v['plugins'], 'index', 'index')}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-home" title="首页" target="_blank"></a>
                                {{/if}}
                            </div>
                        </div>
                    </li>
                {{/foreach}}
            </ul>

            <!-- 删除弹层 -->
            <div class="am-modal am-modal-no-btn" tabindex="-1" id="plugins-delete-modal">
                <div class="am-modal-dialog">
                    <div class="am-modal-hd">
                        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
                    </div>
                    <div class="am-modal-bd am-margin-top-sm">
                        <div class="am-alert  am-text-left" data-am-alert>
                            <p>1. 仅删除应用<span class="am-text-warning">（仅删除应用代码，保留应用数据）</span></p>
                            <p>2. 删除应用并删除数据<span class="am-text-warning">（将删除应用代码和应用数据）</span></p>
                        </div>
                        <p class="am-text-danger am-margin-top">PS：以下操作后均不可恢复，请谨慎操作！</p>
                        <div class="am-margin-top-sm">
                            <button class="am-btn am-btn-danger am-btn-xs am-radius am-icon-circle-o submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/delete')}}" data-id="0" data-value="1" data-view="reload" data-msg="删除后不可恢复、确认操作吗？" title="删除"> 删除应用和数据</button>
                            <button class="am-btn am-btn-warning am-btn-xs am-radius am-icon-remove submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/delete')}}" data-id="0" data-value="0" data-view="reload" data-msg="删除后不可恢复、确认操作吗？" title="删除"> 仅删除应用</button>

                            <button class="am-btn am-btn-success am-btn-xs am-radius am-icon-reply" data-am-modal-close> 再考虑一下</button>
                        </div>
                    </div>
                </div>
            </div>
        {{else /}}
            <div class="table-no">
                <i class="am-icon-warning"></i> 还没有相关应用
                <a href="{{$store_url}}" class="am-margin-left-xs">到应用商店看看 >></a>
            </div>
        {{/if}}
    </div>
</div>
<!-- right content end  -->
        
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->